package com.huping.mapper;

import com.huping.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Insert("insert into student (student_id, name, gender, phone, email) VALUES (#{studentId},#{name},#{gender},#{phone},#{email})")
    int studentInsert(Student student);

    @Update("update student set phone=#{phone},name=#{name},email=#{email},gender=#{gender} where student_id=#{studentId}")
    int updateStudentInformation(Student student);

    @Select("select * from student where student_id=#{userid}")
    Student getStudentInformationByUserid(String userid);

    List<Student> getStudentsByCourseId(String courseId, String userid);

}
